package ExtendDemo.demo08;

import java.io.*;
import java.net.Socket;

public class ClientDemo {
    public static void main(String[] args) throws IOException {
       //创建socket对象
        Socket s=new Socket("192.168.0.101",10002);

        //封装文本文件的数据
        BufferedReader br=new BufferedReader(new FileReader("s.txt"));
        //封装输出流写数据
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));

        String line;
        while ((line=br.readLine())!=null){
            bw.write(line);
            bw.newLine();
            bw.flush();
        }
        bw.close();
        br.close();
        s.close();

    }
}
